﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MATtutsLab.Entities;
using MATtutsLab.Repositories;
using Norm.Collections;

namespace MATtutsLabs.DbTester
{
    class Program
    {
        static void Main(string[] args)
        {
            var repository = new MovieRepository();

            try
            {
                //using (var session = new MongoSession())
                //{
                    //session.DB.CreateCollection(new CreateCollectionOptions("movies"));

                var movie = new Movie
                {
                    Title = "Dawn Of The Dead",
                    ShortDescription = "Dead is a 2004 American horror remake of George A. Romero\u2019s 1978 film of the same name. The remake and original both depict a handful of human survivors living in a shopping mall surrounded by swarms of zombies",
                    LongDescription = "long description",
                    Image = @"http://ecx.images-amazon.com/images/I/51%2BSLdOgNDL.jpg"
                };


                    //session.Add(movie);
                //var existingMovie = repository.GetByTitle("Zombieland");
                //Console.WriteLine(existingMovie.Title);
                
                //existingMovie.Title = "Zombielands";

                repository.Save(movie);
                    Console.WriteLine("Movie successfull added!");

                //var movies = repository.GetAll();

                //foreach (var mymovie in movies)
                //{
                //    Console.WriteLine(mymovie.Title);
                //}
                //}
            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);
            }
        }
    }
}
